﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PPI.Entities.Enumerator;
using PPI.Entities.Lookup;

namespace PPI.Entities.Settings.Mobile
{
    public class EMobileSettingDistribution : EMobileSettingsBase
    {
        private readonly int m_distributionAppMode;
        public EUtility Utility { get; set; }

        public EMobileSettingDistribution(int distributionAppMode)
        {
            m_DatabaseType = (distributionAppMode == 0 ? DatabaseTypes.DistributionGPS : DatabaseTypes.DistributionInspection);
            m_MobileVersion = new EMobileVersion("1234");
            m_Handheld = new EHandheld(1,"X1234");

            m_distributionAppMode = distributionAppMode;
        }

        public EMobileSettingDistribution(int distributionAppMode, EVendor_Contact contact, EVendor vendor, EVendor_Project project, EUtility utility) : this(distributionAppMode)
        {
            Vendor = vendor;
            Contact = contact;
            Project = project;
            Utility = utility;
            m_ListMobileSettings.Add(Vendor);
            m_ListMobileSettings.Add(Contact);
            m_ListMobileSettings.Add(Project);
            m_ListMobileSettings.Add(Utility);
        }

        public override void ConfigurateConfig()
        {
            SetDatabaseTypeName();
            m_ListMobileSettings.Add(new EDistributionAppMode(m_distributionAppMode));
            m_ListMobileSettings.Add(m_DatabaseTypeName);
        }
    }
}
